<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<%@ include file="/common/common-css.jsp" %>
		<%@ include file="/discovery/discovery-css.jsp" %>
		<%@ include file="/common/common-js.jsp" %>
		
		<style type="text/css">
			html, body {
				height: 10000px;
			}
			body {
				height: 10000px;
				padding: 20px;
				background: white;
			}
			.message_responseparams {
				display: none;
			}
			#message_responseparams_container div:nth-child(3) {
				display: block;
			}
			.item_title {
				font-size: 20px;
			}
			.text_input {
				width: 300px;
			}
			.text_input_area {
				width: 600px;
			}
			.file_choose {
				color: red;
			}
			#message_result_show {
				color: red;
				font-size: 15px;
			}
			#button_container {
				text-align: center;
			}
			.load_bg{background:#000;opacity:0.1;left:0px;top:0px;position:fixed;height:100%;width:100%;overflow:hidden;z-index:10000;}
			.load_img{left:50%;top:180px;position:fixed;height:50px;overflow:hidden;z-index:20000;}
		</style>
	</head>
	<body>
		<div  class="load_bg" style="display:none;" ></div>
		<img src="http://img.xmiles.cn/commentloading.gif" class="load_img" style="display:none"/>
		
		<div>
			<textarea id="record_id" class="text_input_area" style="display: none;">${paramsMap.id }</textarea>
			<textarea id="sendproduct" class="text_input_area" style="display: none;">${paramsMap.sendproduct }</textarea>
			<textarea id="sendtype" class="text_input_area" style="display: none;">${paramsMap.sendtype }</textarea>
			<textarea id="senduserid" class="text_input_area" style="display: none;">${paramsMap.senduserid }</textarea>
			<textarea id="push_content" class="text_input_area" style="display: none;">${paramsMap.push_content }</textarea>
			<textarea id="sendtime" class="text_input_area" style="display: none;">${paramsMap.sendtime }</textarea>
			<textarea id="endtime" class="text_input_area" style="display: none;">${paramsMap.endtime }</textarea>
			
			<textarea id="platform" class="text_input_area" style="display: none;">${paramsMap.platform }</textarea>
			<textarea id="provinceid" class="text_input_area" style="display: none;">${paramsMap.provinceid }</textarea>
			<textarea id="tags" class="text_input_area" style="display: none;">${paramsMap.tags }</textarea>
		</div>
		
		<div>
			<div class="item_title">1、消息LOGO(客户端消息中心的LOGO,不是通知栏的)：</div>
			<form id="icon_choose_form" name="icon_choose_form" method="post" enctype="multipart/form-data">
				<input type="file" name="messageIcon"  id="messageIcon" class="file_choose" />
			</form>
			<img id="message_icon_preview" src="${paramsMap.icon }" onerror="javascript:this.src='http://img.xmiles.cn/img/void.png'"/>
		</div>
		<br/>
		<div>
			<div class="item_title">2、消息标题：</div>
			<textarea id="message_title"  class="text_input_area">${paramsMap.title }</textarea>
		</div>
		<br/>
		<div>
			<div class="item_title">3、消息内容：</div>
			<textarea id="message_content" class="text_input_area">${paramsMap.content }</textarea>
		</div>
		<br/>
		<div>
			<div class="item_title">4、IOS通知栏内容：</div>
			<textarea id="ios_push_message_title"  class="text_input_area"/>${paramsMap.ios_content }</textarea>
		</div>
		<br/>
		<div>
			<div class="item_title" >5、消息展示的地方：</div>
			<select id="message_showtype">
			  <option value="0" ${paramsMap.sendtype==0?'selected':''} >不展示，一般用于某些后台操作，不需要展示给用户</option>
			  <option value="1" ${paramsMap.sendtype==1?'selected':''} ${paramsMap.sendtype==null?'style="display: none;"':''} >在我的消息中心展示</option>
			  <option value="2" ${paramsMap.sendtype==2?'selected':''} >在车友圈消息中心展示(暂时没有入口)</option>
			  <option value="3" ${paramsMap.sendtype==3?'selected':''} >同时在我的和车友圈消息中心展示</option>
			  <option value="1" ${paramsMap.sendtype==null?'selected':''} ${paramsMap.sendtype!=null?'style="display: none;"':''} >在我的消息中心展示</option>
			</select>
		</div>
		<br/>
		<div>
			<div class="item_title">6、消息通知的方式：</div>
			<select id="message_notifytype">
			  <option value="0" ${paramsMap.notifyType==0?'selected':''} >不通知，一般用于某些后台操作，不需要通知用户</option>
			  <option value="1" ${paramsMap.notifyType==1?'selected':''} >通知栏通知</option>
			  <option value="2" ${paramsMap.notifyType==2?'selected':''} >站内信通知，即在消息中心入口显示红点</option>
			  <option value="3" ${paramsMap.notifyType==3?'selected':''} ${paramsMap.notifyType==null?'style="display: none;"':''} >通知栏和站内信都通知</option>
			  <option value="3" ${paramsMap.notifyType==null?'selected':''} ${paramsMap.notifyType!=null?'style="display: none;"':''} >通知栏和站内信都通知</option>
			</select>
		</div>
		<br/>
		<div>
			<div class="item_title">7、消息点击的响应方式：</div>
			<!--
			<select id="message_responsetype">
			  
			  <option value="1">升起浮窗显示</option>
			  <option value="2" selected="selected">跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)</option>
			  <option value="3">重新从服务器拉一条新的消息体下来；如果为该值，showType和notifyType都会忽略，不会展示和通知用户</option>
			</select>
			-->
			<select id="message_responsetype">
			  <option value="0" ${paramsMap.responseType==0?'selected':''} >后台处理，用于某些后台操作指令；如果为该值，showType和notifyType都会忽略，不会展示和通知用户</option>
			  <option value="2" ${paramsMap.responseType==2?'selected':''} ${paramsMap.responseType==null?'style="display: none;"':'' } >跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)</option>
			  <option value="4" ${paramsMap.responseType==4?'selected':''} >浮层显示（跳转本应用的页面)</option>
			  <option value="2" ${paramsMap.responseType==null?'selected':''}  ${paramsMap.responseType!=null?'style="display: none;"':'' } >跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)</option>
			</select>
		</div>
		<br/>
		<div>
			<div class="item_title">8、消息的响应参数：</div>
			<div id="message_responseparams_container">
				<!--后台处理，用于某些后台操作指令-->
				<div id="message_responseparams_0" class="message_responseparams">
					<select id="operate_type">
					</select>
					<br/>
					<div id="operate_params">
					</div>
				</div>
				<!--升起浮窗显示-->
				<div id="message_responseparams_1" class="message_responseparams"></div>
				<!--跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)-->
				<div id="message_responseparams_2" class="message_responseparams">
					<select id="launch_type">
					</select>
					<br/>
					<div id="launch_params">
					</div>
				</div>
				<!--重新从服务器拉一条新的消息体-->
				<div id="message_responseparams_3" class="message_responseparams"></div>
				<!-- 浮层显示 -->
				<div id="message_responseparams_4" class="message_responseparams">
					<select id="launch_type_fc">
					</select>
					<br/>
					<div id="launch_params_fc">
					</div>
				</div>
			</div>
		</div>
		<br/>
		<div id="button_container">
			<button id="create_button" type="button">生成消息</button>
			<button id="copy_button" type="button">复制消息</button>
			<button id="send_button" type="button">推送消息</button>
		</div>
		<br/>
		<div id="message_result_show"></div>
	</body>
</html>

<script type="text/javascript" src="${ctx}/js/call_func.js"></script>
<script type="text/javascript" src="../js/jquery.zclip.min.js"></script> 

<script type="text/javascript">
	var debug = true;
	//url参数
	var url = "http://" + location.host + "/";
	//后台操作选择下标
	var operateTypeSelectIndex = 0;
	//跳转选择下标
	var launchTypeSelectIndex = 0;
	//当前显示的的跳转参数选项id
	var showMessageResponseparamsId = "message_responseparams_2";
	window.onload = function(){
		
		//
		var newShowMessageResponseparamsId = "message_responseparams_" + getSelectValueById("message_responsetype");
		if (showMessageResponseparamsId != newShowMessageResponseparamsId) {
			document.getElementById(newShowMessageResponseparamsId).style.display = "block";
			document.getElementById(showMessageResponseparamsId).style.display = "none";
			showMessageResponseparamsId = newShowMessageResponseparamsId;
		}

		//消息logo
		var messageIconChoose = document.getElementById("messageIcon");
		messageIconChoose.onchange = function() {
			var file = this.files[0];
			var fileReader = new FileReader();
			fileReader.readAsDataURL(file);
			$(fileReader).load(function(){
				$('#message_icon_preview').attr('src',this.result);
				$('#messageIcon').attr('value',this.result);
			});
		};
		var messageIconPreview = document.getElementById("message_icon_preview");
		//消息点击的响应方式下拉选择
		var messageResponsetype = document.getElementById("message_responsetype");
		//监听下拉列表选择的变化
		messageResponsetype.onchange = function () {
			//不同的响应方式，显示不同的参数配置
			var newShowMessageResponseparamsId = "message_responseparams_" + getSelectValueById("message_responsetype");
			if (showMessageResponseparamsId != newShowMessageResponseparamsId) {
				document.getElementById(newShowMessageResponseparamsId).style.display = "block";
				document.getElementById(showMessageResponseparamsId).style.display = "none";
				showMessageResponseparamsId = newShowMessageResponseparamsId;
			}
		};
		//创建按钮
		var createButton = document.getElementById("create_button");
		createButton.onclick = function() {
			var messageIconChoose = document.getElementById("messageIcon");
			var iconValue = messageIconChoose.value;
			if (iconValue != null && iconValue.trim() != "") {
				//如果有选择图片，要先把图片上传到7牛，才能生成消息
				uploadImg();
			} else {
				//否则直接生成
				var iconurl = $("#message_icon_preview").attr("src");
				if (iconurl == "http://img.xmiles.cn/img/void.png") {
					iconurl = null;
				}
				var newMessage = createMessage(iconurl);
				var messageResultShow = document.getElementById("message_result_show");
				messageResultShow.innerHTML = JSON.stringify(newMessage);
			}
		};
		//复制按钮
		$('#copy_button').zclip({
			path: '../js/ZeroClipboard.swf',
			copy: function(){
				var messageResultShow = document.getElementById("message_result_show");
				var text = messageResultShow.innerHTML;
				return text;
			},
			afterCopy: function(){
				alert("消息内容已经复制的系统粘贴板");
			}
		});
		//推送按钮
		var sendButton = document.getElementById("send_button");
		sendButton.onclick = function() {
			
			var record_id = $("#record_id").val();
			var sendproduct = $("#sendproduct").val();
			var sendtype = $("#sendtype").val();
			var senduserid = $("#senduserid").val();
			var push_content = $("#push_content").val();
			var sendtime = $("#sendtime").val();
			var endtime = $("#endtime").val();
			var platform = $("#platform").val();
			var provinceid = $("#provinceid").val();
			var tags = $("#tags").val();
			
			var messageResultShow = document.getElementById("message_result_show");
			var message = messageResultShow.innerHTML;
			if (message == null || message.trim() == "") {
				alert("请先点击“生成消息”按钮，生成消息。");
				return;
			}
			var openUrl = "/pushmanage/send_message.jsp?message=" + encodeURIComponent(encodeURIComponent(message)) + "&record_id=" + record_id + "&sendproduct=" + sendproduct + "&sendtype=" + sendtype + "&senduserid=" + senduserid + "&push_content=" + push_content + "&sendtime=" + sendtime + "&endtime=" + endtime + "&platform=" + platform + "&provinceid=" + provinceid + "&tags=" + tags;
			var iosLockKeyInput = document.getElementById("ios_push_message_title");
			var lockKey = iosLockKeyInput.value;
			if (lockKey != null && lockKey.trim() != "") {
				lockKey = lockKey.replace(new RegExp("%","gm"), "%25");
				openUrl = openUrl + "&lockkey=" + encodeURIComponent(encodeURIComponent(lockKey));
			}
			openDialogWithRand(openUrl, 700, 800, "推送消息", function (data){});
		};
		
		//后台处理，用于某些后台操作指令
		//初始化后台操作选择
		initOperateTypeSelect();
		initOperateParamsBySelectIndex();
		//跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)
		//初始化跳转应用的下拉选择列表
		initLaunchTypeSelect("launch_type","launch_params");
		initLaunchParamsBySelectIndex("launch_params");
		
		initLaunchTypeSelectFC("launch_type_fc","launch_params_fc");
		initLaunchParamsBySelectIndexFC("launch_params_fc");
	};
	
	/* 	var responseType = ${paramsMap.responsetype };
		$("#message_responsetype option").removeAttr("select");
		$("#message_responsetype option").removeAttr("selected");
		$("#message_responsetype option[value='" + responseType + "']").attr("select","selected"); 
	*/
	
	/**
	 * 创建消息的方法
	 */
	function createMessage(messageIcon) {
		var newMessage = {};
		//icon
		var icon = messageIcon == null ? "" : messageIcon;
		newMessage.icon = icon;
		//title
		var messageTitle = document.getElementById("message_title");
		//newMessage.title = messageTitle.value;
		newMessage.title = messageTitle.value.replace(new RegExp("%","gm"), "%25");
		//content
		var messageContent = document.getElementById("message_content");
		//newMessage.content = messageContent.value;
		newMessage.content = messageContent.value.replace(new RegExp("%","gm"), "%25");
		//showType
		newMessage.showType = parseInt(getSelectValueById("message_showtype"));
		//notifyType
		newMessage.notifyType = parseInt(getSelectValueById("message_notifytype"));
		//responseType
		newMessage.responseType = parseInt(getSelectValueById("message_responsetype"));
		//responseParams
		newMessage.responseParams = createResponseParams();
		return newMessage;
	};
	
	/**
	 * 创建响应参数的方法
	 */
	function createResponseParams(){
		var responseType = parseInt(getSelectValueById("message_responsetype"));
		var responseParams = {};
		if (responseType == 0) {
			if (responseparamsType1Params != null) {
			    var item = responseparamsType1Params[operateTypeSelectIndex];
			    if (item != null) {
					responseParams.operate = item.operate;
					var operateParams = {};
					var itemOperateParams = item.operateParams;
					if (itemOperateParams != null) {
						var length = itemOperateParams.length;
						for (var i = 0; i < length; i++) {
							var paramsItem = itemOperateParams[i];
							var name = paramsItem.name;
							var type = paramsItem.type;
							if (type == 0) {
								var input = document.getElementById(name + "_input");
								var value = input.value;
								//这里如果是http地址，要把里面的"&"替换掉
								if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.trim();
								}
								if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.replace(new RegExp("&","gm"), "%2526")
									
								} else if (value.indexOf("%") >= 0) {
									value = value.replace(new RegExp("%","gm"), "%25");
								} 
								operateParams[name] = value;
								if(name=="imageList"){
									var imageList=value.split(",");
									operateParams[name]=imageList;
								}
							} else if (type == 1) {
								operateParams[name] = parseInt(getRadioValueByName(name));
							} else if (type == 2) {
								operateParams[name] = parseInt(getSelectValueById(name + "_select"));
							} else if (type == 3) {
								var input = document.getElementById(name + "_input");
								var value = input.value;
								if (value != null && value != "" && value != "0") {
									value = value.replace(/-/g,"/");
									var time = new Date(value);
									value = time.getTime();
								} 
								operateParams[name] = value;
							} else if (type == 4) {
								var params = createResponsecurTyp2Params();
								operateParams[name] = JSON.stringify(params);
							}
						}
					}
					responseParams.operateParams = operateParams;
				}
			}
		} else if (responseType == 1) {
		
		} else if (responseType == 2) {
			if (responseparamsType2Params != null) {
			    var item = responseparamsType2Params[launchTypeSelectIndex];
			    if (item != null) {
					responseParams.launch = item.launch;
					var launchParams = {};
					var itemLaunchParams = item.launchParams;
					if (itemLaunchParams != null) {
						var length = itemLaunchParams.length;
						for (var i = 0; i < length; i++) {
							var paramsItem = itemLaunchParams[i];
							var name = paramsItem.name;
							var type = paramsItem.type;
							if (type == 0) {
								var input = document.getElementById(name + "_input");
								var value = input.value;
								//这里如果是http地址，要把里面的"&"替换掉
								if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.trim();
								}
								if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.replace(new RegExp("&","gm"), "%2526");
								} else if (value.indexOf("%") >= 0) {
									value = value.replace(new RegExp("%","gm"), "%25");
								}
								launchParams[name] = value;
							} else if (type == 1) {
								launchParams[name] = parseInt(getRadioValueByName(name));
							} else if (type == 2) {
								launchParams[name] = parseInt(getSelectValueById(name + "_select"));
							}
						}
					}
					responseParams.launchParams = launchParams;
				}
			}
		} else if (responseType == 3) {
		
		}
		else if (responseType == 4) {
			var item = responseparamsType4Params[launchTypeSelectIndex];
		    if (item != null) {
				responseParams.launch = item.launch;
				var launchParams = {};
				var itemLaunchParams = item.launchParams;
				
				if (itemLaunchParams != null) {
					var length = itemLaunchParams.length;
					for (var i = 0; i < length; i++) {
						var paramsItem = itemLaunchParams[i];
						var name = paramsItem.name;
						var type = paramsItem.type;
						if (type == 0) {
							var input = document.getElementById(name + "_input");
							var value = input.value;
							//这里如果是http地址，要把里面的"&"替换掉
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.trim();
							}
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
								value = value.replace(new RegExp("&","gm"), "%26");
							} else if (value.indexOf("%") >= 0) {
								value = value.replace(new RegExp("%","gm"), "%25");
							}
							launchParams[name] = value;
						} else if (type == 1) {
							launchParams[name] = parseInt(getRadioValueByName(name));
						} else if (type == 2) {
							launchParams[name] = parseInt(getSelectValueById(name + "_select"));
						}
					}
				}
				var list = item.list;
				if(list!=null){
					for( var i = 0; i < list.length; i++){
						
						var paramsItem = list[i];
						var name = paramsItem.name;
						var type = paramsItem.type;
						if (type == 0) {
							var input = document.getElementById(name + "_input");
							var value = input.value;
							//这里如果是http地址，要把里面的"&"替换掉
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.trim();
							}
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
								value = value.replace(new RegExp("&","gm"), "%26");
							} else if (value.indexOf("%") >= 0) {
								value = value.replace(new RegExp("%","gm"), "%25");
							}
							//launchParams[name] = value;
							
							if(name=="beforeClickImgList"){
								var imgUrl=value.split(",");
								responseParams.beforeClickImgList=imgUrl;
							}
							if(name=="afterClickImgList"){
								var imgUrl=value.split(",");
								responseParams.afterClickImgList=imgUrl;
							}
							if(name=="beforeFrameTime"){
								responseParams.beforeFrameTime=value;
							}
							if(name=="afterFrameTime"){
								responseParams.afterFrameTime=value;
							}
							
						} else if (type == 1) {
							launchParams[name] = parseInt(getRadioValueByName(name));
						} else if (type == 2) {
							launchParams[name] = parseInt(getSelectValueById(name + "_select"));
						}
					}
				}
				responseParams.launchParams = launchParams;
				responseParams.launchParams.launch=item.launch;
			}
		}
		return responseParams;
	};
	
	function createResponsecurTyp2Params() {
		var responseParams = {};
		if (responseparamsType2Params != null) {
		    var item = responseparamsType2Params[launchTypeSelectIndex];
		    if (item != null) {
				responseParams.launch = item.launch;
				var launchParams = {};
				var itemLaunchParams = item.launchParams;
				if (itemLaunchParams != null) {
					var length = itemLaunchParams.length;
					for (var i = 0; i < length; i++) {
						var paramsItem = itemLaunchParams[i];
						var name = paramsItem.name;
						var type = paramsItem.type;
						if (type == 0) {
							var input = document.getElementById(name + "_input");
							var value = input.value;
							//这里如果是http地址，要把里面的"&"替换掉
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
									value = value.trim();
							}
							if (value.indexOf("http") >= 0 || value.indexOf("https") >= 0) {
								value = value.replace(new RegExp("&","gm"), "%2526");
							} else if (value.indexOf("%") >= 0) {
								value = value.replace(new RegExp("%","gm"), "%25");
							}
							launchParams[name] = value;
						} else if (type == 1) {
							launchParams[name] = parseInt(getRadioValueByName(name));
						} else if (type == 2) {
							launchParams[name] = parseInt(getSelectValueById(name + "_select"));
						}
					}
				}
				responseParams.launchParams = launchParams;
			}
		}
		return responseParams;
	};
	
	/**
	 * 初始化后台操作选择
	 */
	function initOperateTypeSelect() {
		var operateType = document.getElementById("operate_type");
		var html = "";
		if (responseparamsType1Params != null) {
			var length = responseparamsType1Params.length;
			for (var i = 0; i < length; i++) {
				var item = responseparamsType1Params[i];
				html = html + "<option value='" + i + "'>" + item.name + "</option>";
			}
		}
		operateType.innerHTML = html;
		
		var selectedIndex = "${paramsMap.operate }";// 1-0		11-1	8-2		13-3	null-0
		if (selectedIndex == null || selectedIndex == 1) {
			selectedIndex = 0;
		} else if (selectedIndex == 11) {
			selectedIndex = 1;
		} else if (selectedIndex == 8) {
			selectedIndex = 2;
		} else if (selectedIndex == 13) {
			selectedIndex = 3;
		}
		
		$("#operate_type option[value='"+selectedIndex+"']").attr("selected",true);
		
		if (operateTypeSelectIndex != selectedIndex) {
			operateTypeSelectIndex = selectedIndex;
			initOperateParamsBySelectIndex();
		}
		
		operateType.onchange = function(){
			//跳转选择改变，跳转参数也要改变
			var selectIndex = this.selectedIndex; 
			if (operateTypeSelectIndex != selectIndex) {
				operateTypeSelectIndex = selectIndex;
				initOperateParamsBySelectIndex();
			}
		};
	};
	
	/**
	 * 根据选择的后台操作下标，初始化要填写的参数
	 */
	function initOperateParamsBySelectIndex() {
		var operateParamsDiv = document.getElementById("operate_params");
		var html = "";
		if (responseparamsType1Params != null) {
			var item = responseparamsType1Params[operateTypeSelectIndex];
			if (item != null) {
				var operateParams = item.operateParams;
				if (operateParams != null) {
					var length = operateParams.length;
					for (var i = 0; i < length; i++) {
						var paramsItem = operateParams[i];
						var type = paramsItem.type;
						var def = paramsItem.def;
						html = html + "<div id='" + paramsItem.name + "'><div>"+ paramsItem.description +":</div>"
						if (type == 0) {
							//输入类型的
							html = html + "<input class='text_input' id='" +  paramsItem.name + "_input' type='text' ";
							if (def != null) {
								html = html + "value='" + def + "'";
							}
							html = html + "/>";
						} else if (type == 1) {
							//0,1单选类型
							html = html + "<label><input type='radio' name='" + paramsItem.name + "' value='0' ";
							if (def != null && def == 0) {
								html = html + "checked='checked'";
							}
							html = html + "/>否</label><label><input type='radio' name='" + paramsItem.name + "' value='1' ";
							if (def != null && def == 1) {
								html = html + "checked='checked'";
							}
							html = html + "/>是</label>";
						} else if (type == 2) {
							var options = paramsItem.option;
							if (options != null) {
								var optionLength = options.length;
								html = html + "<select id='" + paramsItem.name + "_select'>";
								for (var j = 0; j < optionLength; j++) {
									var optionItem = options[j];
									html = html + " <option value='" + optionItem.value + "'";
									if (optionItem.value == def){
										html = html + " selected='selected' ";
									}
									html = html + ">" + optionItem.name + "</option>";
								}
								html = html + "</select>";
							}
						} else if (type == 3) {
							html = html + '<input class="form-control date-picker text_input" data-date-format="yyyy-mm-dd hh:ii:ss" type="text" id="' +  paramsItem.name + '_input" />';
						} else if (type == 4) {
							var selectid = paramsItem.name + "_launch_type";
							var paramsid = paramsItem.name + "_launch_params";
							html = html + "<div class='launch_container'><select id='" + selectid + "'></select><br/><div id='" + paramsid + "'></div></div>";
						}
						html = html + "</div>";
					}
				}
			}
		}
		operateParamsDiv.innerHTML = html;
		
  		var operateParams_state = "${paramsMap.operateParams_state }";  
		if (operateParams_state == null || operateParams_state == "") {
			operateParams_state = 0;
		}
		$("#state option[value=" + operateParams_state + "]").attr("selected",true);
		
		var operateParams_text = "${paramsMap.operateParams_text }";
		if (operateParams_text == null || operateParams_text == "") {
			operateParams_text = "";
		}
		$("#text_input").val(operateParams_text);
		
		var operateParams_action = "${paramsMap.operateParams_action }";
		if (operateParams_action == null || operateParams_action == "") {
			operateParams_action = 1;
		}
		$("#action_select option[value=" + operateParams_action + "]").attr("selected",true);
		
		var operateParams_value = "${paramsMap.operateParams_value }";
		if (operateParams_value == null || operateParams_value == "") {
			operateParams_value = "";
		}
		$("#value_input").val(operateParams_value);
		
		var operateParams_resident = "${paramsMap.operateParams_resident }";
		if (operateParams_resident == null || operateParams_resident == "") {
			operateParams_resident = 0;
		}
		$("#resident_select option[value=" + operateParams_resident + "]").attr("selected",true);
		
		var operateParams_timestamp = "${paramsMap.operateParams_timestamp }";
		if (operateParams_timestamp == null || operateParams_timestamp == "") {
			operateParams_timestamp = "";
		}
		$("#timestamp_input").val(operateParams_timestamp);
		
		var operateParams_tabid = "${paramsMap.operateParams_tabid }";
		if (operateParams_tabid == null | operateParams_tabid == "") {
			operateParams_tabid = 0;
		}
		$("#tabid_select option[value=" + operateParams_tabid + "]").attr("selected",true);
		
		var operateParams_starttime = "${paramsMap.operateParams_starttime }";
		if (operateParams_starttime == null || operateParams_starttime == "") {
			operateParams_starttime = "";
		}
		$("#starttime_input").val(operateParams_starttime);
		
		var operateParams_endtime = "${paramsMap.operateParams_endtime }";
		if (operateParams_endtime == null || operateParams_endtime == "") {
			operateParams_endtime = "";
		}
		$("#endtime_input").val(operateParams_timestamp);
		
		var operateParams_pop_img_url = "${paramsMap.operateParams_pop_img_url }";
		if (operateParams_pop_img_url == null || operateParams_pop_img_url == "") {
			operateParams_pop_img_url = "";
		}
		$("#pop_img_url_input").val(operateParams_pop_img_url);
		
		var operateParams_msg_center_show = "${paramsMap.operateParams_msg_center_show }";
		if (operateParams_msg_center_show == null | operateParams_msg_center_show == "") {
			operateParams_msg_center_show = 0;
		}
		$("#msg_center_show_select option[value=" + operateParams_msg_center_show + "]").attr("selected",true);
		
		var operateParams_index = "${paramsMap.operateParams_index }";
		if (operateParams_index == null || operateParams_index == "") {
			operateParams_index = "";
		}
		$("#index_input").val(operateParams_index);
		var operateParams_imageList = "${paramsMap.operateParams_imageList }";
		if (operateParams_imageList == null || operateParams_imageList == "") {
			operateParams_imageList = "";
		}
		$("#imageList_input").val(operateParams_imageList);
		var operateParams_time = "${paramsMap.operateParams_time }";
		if (operateParams_time == null || operateParams_time == "") {
			operateParams_time = "";
		}
		$("#time_input").val(operateParams_time);
		var operateParams_type = "${paramsMap.operateParams_type }";
		if (operateParams_type == null || operateParams_type == "") {
			operateParams_type = "";
		}
		$("#type_input").val(operateParams_type);
		
		$(".launch_container").each(function(){
			var typeSelect = $(this).children("select").eq(0);
			var paramsDiv = $(this).children("div").eq(0);
			var selectId = typeSelect.attr("id");
			var divId = paramsDiv.attr("id");
			console.log("selectId:" + selectId);
			console.log("divId:" + divId);
			initLaunchTypeSelect(selectId,divId);
			initLaunchParamsBySelectIndex(divId);
		});
		//时间控件
		$('.date-picker').datetimepicker({
			autoclose:true,
			startDate: new Date()
		}).next().on(ace.click_event, function(){
			$(this).prev().focus();
		});
	};
	
	
	/**
	 * 初始化跳转应用的下拉选择列表
	 */
	function initLaunchTypeSelect(selectid, paramsid) {
		//var launchType = document.getElementById("launch_type");
		var launchType = document.getElementById(selectid);
		var html = "";
		if (responseparamsType2Params != null) {
			var length = responseparamsType2Params.length;
			for (var i = 0; i < length; i++) {
				var item = responseparamsType2Params[i];
				html = html + "<option value='" + i + "'>" + item.name + "</option>";
			}
		}
		launchType.innerHTML = html;
		
 		var selectedIndex = 0;
 		var launch = "${paramsMap.launch }";
 		if (launch == "" || launch == null) {
 			selectedIndex = 0;
 		} else if (launch == "launch_other_browser") {
 			selectedIndex = 1;
 		} else if (launch == "launch_vc_webView") {
 			selectedIndex = 2;
 		} else if (launch == "launch_vc_message_center") {
 			selectedIndex = 3;
 		} else if (launch == "launch_main_tab") {
 			selectedIndex = 4;
 		} else if (launch == "launch_vc_my_comment") {
 			selectedIndex = 5;
 		} else if (launch == "launch_vc_my_order") {
 			selectedIndex = 6;
 		} else if (launch == "launch_vc_order_detail") {
 			selectedIndex = 7;
 		} else if (launch == "launch_vc_illegal_home") {
 			selectedIndex = 8;
 		} else if (launch == "launch_vc_illegal_edit") {
 			selectedIndex = 9;
 		} else if (launch == "launch_vc_illegal_detail") {
 			selectedIndex = 10;
 		} else if (launch == "launch_vc_proxy_driving") {
 			selectedIndex = 11;
 		} else if (launch == "launch_vc_proxy_helper") {
 			selectedIndex = 12;
 		} else if (launch == "launch_vc_proxy_insurance") {
 			selectedIndex = 13;
 		} else if (launch == "launch_vc_map_view") {
 			selectedIndex = 14;
 		} else if (launch == "launch_vc_list_view") {
 			selectedIndex = 15;
 		} else if (launch == "launch_vc_groupbuy_list") {
 			selectedIndex = 16;
 		} else if (launch == "launch_vc_detail") {
 			selectedIndex = 17;
 		} else if (launch == "launch_vc_contribute") {
 			selectedIndex = 20;
 		} else if (launch == "launch_vc_write_review") {
 			selectedIndex = 19;
 		} else if (launch == "launch_vc_contribute") {
 			selectedIndex = 18;
 		} else if (launch == "launch_vc_worth_outlink_detail") {
 			selectedIndex = 21;
 		} else if (launch == "launch_vc_dialog_webview") {
 			selectedIndex = 22;
 		} else if (launch == "launch_vc_supernatant_webView") {
 			selectedIndex = 23;
 		} 
		$("#launch_type option[value='" + selectedIndex + "']").attr("selected", true);
		if (launchTypeSelectIndex != selectedIndex) {
			launchTypeSelectIndex = selectedIndex;
			initLaunchParamsBySelectIndex(paramsid);
		}
		
		launchType.onchange = function(){
			//跳转选择改变，跳转参数也要改变
			var selectIndex = this.selectedIndex; 
			if (launchTypeSelectIndex != selectIndex) {
				launchTypeSelectIndex = selectIndex;
				initLaunchParamsBySelectIndex(paramsid);
			}
		};
	};
	/**
	 * 根据选择的跳转下标，初始化要填写的参数
	 */
	function initLaunchParamsBySelectIndex(paramsid) {
		//var launchParamsDiv = document.getElementById("launch_params");
		var launchParamsDiv = document.getElementById(paramsid);
		var html = "";
		if (responseparamsType2Params != null) {
			var item = responseparamsType2Params[launchTypeSelectIndex];
			if (item != null) {
				var launchParams = item.launchParams;
				var list = item.list;
				if(list!=null){
					var length = list.length;
					for(var i = 0; i < length; i++){
						var paramsItem = list[i];
						var type = paramsItem.type;
						var def = paramsItem.def;
						html = html + "<div id='" + paramsItem.name + "'><div>"+ paramsItem.description +":</div>"
						if (type == 0) {
							//输入类型的
							html = html + "<input class='text_input' id='" +  paramsItem.name + "_input' type='text' ";
							if (def != null) {
								html = html + "value='" + def + "'";
							}
							html = html + "/>";
						} else if (type == 1) {
							//0,1单选类型
							html = html + "<label><input type='radio' name='" + paramsItem.name + "' value='0' ";
							if (def != null && def == 0) {
								html = html + "checked='checked'";
							}
							html = html + "/>否</label><label><input type='radio' name='" + paramsItem.name + "' value='1' ";
							if (def != null && def == 1) {
								html = html + "checked='checked'";
							}
							html = html + "/>是</label>";
						} else if (type == 2) {
							var options = paramsItem.option;
							if (options != null) {
								var optionLength = options.length;
								html = html + "<select id='" + paramsItem.name + "_select'>";
								for (var j = 0; j < optionLength; j++) {
									var optionItem = options[j];
									html = html + " <option value='" + optionItem.value + "'";
									if (optionItem.value == def){
										html = html + " selected='selected' ";
									}
									html = html + ">" + optionItem.name + "</option>";
								}
								html = html + "</select>";
							}
						}
						html = html + "</div>";
					}
				}
				if (launchParams != null) {
					var length = launchParams.length;
					for (var i = 0; i < length; i++) {
						var paramsItem = launchParams[i];
						var type = paramsItem.type;
						var def = paramsItem.def;
						html = html + "<div id='" + paramsItem.name + "'><div>"+ paramsItem.description +":</div>"
						if (type == 0) {
							//输入类型的
							html = html + "<input class='text_input' id='" +  paramsItem.name + "_input' type='text' ";
							if (def != null) {
								html = html + "value='" + def + "'";
							}
							html = html + "/>";
						} else if (type == 1) {
							//0,1单选类型
							html = html + "<label><input type='radio' name='" + paramsItem.name + "' value='0' ";
							if (def != null && def == 0) {
								html = html + "checked='checked'";
							}
							html = html + "/>否</label><label><input type='radio' name='" + paramsItem.name + "' value='1' ";
							if (def != null && def == 1) {
								html = html + "checked='checked'";
							}
							html = html + "/>是</label>";
						} else if (type == 2) {
							var options = paramsItem.option;
							if (options != null) {
								var optionLength = options.length;
								html = html + "<select id='" + paramsItem.name + "_select'>";
								for (var j = 0; j < optionLength; j++) {
									var optionItem = options[j];
									html = html + " <option value='" + optionItem.value + "'";
									if (optionItem.value == def){
										html = html + " selected='selected' ";
									}
									html = html + ">" + optionItem.name + "</option>";
								}
								html = html + "</select>";
							}
						}
						html = html + "</div>";
					}
				}
			}
		}
		launchParamsDiv.innerHTML = html;
		
		var launchParams_title = "${paramsMap.launchParams_title }";  
		if (launchParams_title == null || launchParams_title == "") {
			launchParams_title = "";
		}
		$("#title_input").val(launchParams_title);
		var htmlUrl = "${paramsMap.htmlUrl }";  
		if (htmlUrl == null || htmlUrl == "") {
			htmlUrl = "";
		}
		$("#htmlUrl_input").val(htmlUrl);
		var withHead = "${paramsMap.withHead }";  
		if (withHead == null || withHead == "") {
			withHead = 1;
		}
		$("#withHead").find("input[value='" + withHead + "']").attr("checked","checked");
		var showToolbar = "${paramsMap.showToolbar }";  
		if (showToolbar == null || showToolbar == "") {
			showToolbar = 0;
		}
		$("#showToolbar").find("input[value='" + showToolbar + "']").attr("checked","checked");
		var clearTop = "${paramsMap.clearTop }";  
		if (clearTop == null || clearTop == "") {
			clearTop = 0;
		}
		$("#clearTop").find("input[value='" + clearTop + "']").attr("checked","checked");
		var canBlockNetworkImg = "${paramsMap.canBlockNetworkImg }";  
		if (canBlockNetworkImg == null || canBlockNetworkImg == "") {
			canBlockNetworkImg = 1;
		}
		$("#canBlockNetworkImg").find("input[value='" + canBlockNetworkImg + "']").attr("checked","checked");
		var reloadWhenLogin = "${paramsMap.reloadWhenLogin }";  
		if (reloadWhenLogin == null || reloadWhenLogin == "") {
			reloadWhenLogin = 1;
		}
		$("#reloadWhenLogin").find("input[value='" + reloadWhenLogin + "']").attr("checked","checked");
		var takeOverBackPressed = "${paramsMap.takeOverBackPressed }";  
		if (takeOverBackPressed == null || takeOverBackPressed == "") {
			takeOverBackPressed = 0;
		}
		$("#takeOverBackPressed").find("input[value='" + takeOverBackPressed + "']").attr("checked","checked");
		var callbackWhenResumeAndPause = "${paramsMap.callbackWhenResumeAndPause }";  
		if (callbackWhenResumeAndPause == null || callbackWhenResumeAndPause == "") {
			callbackWhenResumeAndPause = 0;
		}
		$("#callbackWhenResumeAndPause").find("input[value='" + callbackWhenResumeAndPause + "']").attr("checked","checked");
		var showTitle = "${paramsMap.showTitle }";  
		if (showTitle == null || showTitle == "") {
			showTitle = 1;
		}
		$("#showTitle").find("input[value='" + showTitle + "']").attr("checked","checked");
		var injectCss = "${paramsMap.injectCss }";  
		if (injectCss == null || injectCss == "") {
			injectCss = 0;
		}
		$("#injectCss").find("input[value='" + injectCss + "']").attr("checked","checked");
		var launchParams_showMsgType = "${paramsMap.launchParams_showMsgType }";  
		if (launchParams_showMsgType == null || launchParams_showMsgType == "") {
			launchParams_showMsgType = 1;
		}
		$("#showMsgType_select option[value='"+launchParams_showMsgType+"']").attr("selected",true);
		var launchParams_tab = "${paramsMap.launchParams_tab }";  
		if (launchParams_tab == null || launchParams_tab == "") {
			launchParams_tab = 0;
		}
		$("#tab_select option[value='"+launchParams_tab+"']").attr("selected",true);
		var launchParams_id = "${paramsMap.launchParams_id }";  
		if (launchParams_id == null || launchParams_id == "") {
			launchParams_id = "";
		}
		$("#id_input").val(launchParams_id);
		var launchParams_servicetype = "${paramsMap.launchParams_servicetype }";  
		if (launchParams_servicetype == null || launchParams_servicetype == "") {
			launchParams_servicetype = "";
		}
		$("#servicetype_input").val(launchParams_servicetype);
		var launchParams_car_num = "${paramsMap.launchParams_car_num }";  
		if (launchParams_car_num == null || launchParams_car_num == "") {
			launchParams_car_num = "";
		}
		$("#car_num_input").val(launchParams_car_num);
		var launchParams_eng_num = "${paramsMap.launchParams_eng_num }";  
		if (launchParams_eng_num == null || launchParams_eng_num == "") {
			launchParams_eng_num = "";
		}
		$("#eng_num_input").val(launchParams_eng_num);
		var launchParams_shelf_num = "${paramsMap.launchParams_shelf_num }";  
		if (launchParams_shelf_num == null || launchParams_shelf_num == "") {
			launchParams_shelf_num = "";
		}
		$("#shelf_num_input").val(launchParams_shelf_num);
		var launchParams_owner_name = "${paramsMap.launchParams_owner_name }";  
		if (launchParams_owner_name == null || launchParams_owner_name == "") {
			launchParams_owner_name = "";
		}
		$("#owner_name_input").val(launchParams_owner_name);
		var launchParams_owner_phone = "${paramsMap.launchParams_owner_phone }";  
		if (launchParams_owner_phone == null || launchParams_owner_phone == "") {
			launchParams_owner_phone = "";
		}
		$("#owner_phone_input").val(launchParams_owner_phone);
		var launchParams_registerno = "${paramsMap.launchParams_registerno }";  
		if (launchParams_registerno == null || launchParams_registerno == "") {
			launchParams_registerno = "";
		}
		$("#registerno_input").val(launchParams_registerno);
		var launchParams_city = "${paramsMap.launchParams_city }";  
		if (launchParams_city == null || launchParams_city == "") {
			launchParams_city = "";
		}
		$("#city_input").val(launchParams_city);
		var launchParams_serviceType = "${paramsMap.launchParams_serviceType }";  
		if (launchParams_serviceType == null || launchParams_serviceType == "") {
			launchParams_serviceType = "";
		}
		$("#serviceType_input").val(launchParams_serviceType);
		var launchParams_productId = "${paramsMap.launchParams_productId }";  
		if (launchParams_productId == null || launchParams_productId == "") {
			launchParams_productId = "";
		}
		$("#productId_input").val(launchParams_productId);
		var launchParams_merchantId = "${paramsMap.launchParams_merchantId }";  
		if (launchParams_merchantId == null || launchParams_merchantId == "") {
			launchParams_merchantId = "";
		}
		$("#merchantId_input").val(launchParams_merchantId);
		var launchParams_isaddpoint = "${paramsMap.launchParams_isaddpoint }";  
		if (launchParams_isaddpoint == null || launchParams_isaddpoint == "") {
			launchParams_isaddpoint = 1;
		}
		$("#isaddpoint").find("input[value='" + launchParams_isaddpoint + "']").attr("checked","checked");
		
		var launchParams_beforeClickImgList = "${paramsMap.launchParams_beforeClickImgList }";  
		if (launchParams_beforeClickImgList == null || launchParams_beforeClickImgList == "") {
			launchParams_beforeClickImgList = "";
		}
		$("#beforeClickImgList_input").val(launchParams_beforeClickImgList);
	};
	
	/**
	 * 初始化浮层列表
	 */
	function initLaunchTypeSelectFC(selectid, paramsid) {
		//var launchType = document.getElementById("launch_type");
		var launchType = document.getElementById(selectid);
		var html = "";
		if (responseparamsType4Params != null) {
			var length = responseparamsType4Params.length;
			for (var i = 0; i < length; i++) {
				var item = responseparamsType4Params[i];
				html = html + "<option>" + item.name + "</option>";
			}
		}
		launchType.innerHTML = html;
		
		launchType.onchange = function(){
			//跳转选择改变，跳转参数也要改变
			var selectIndex = this.selectedIndex; 
			alert(selectIndex);
			if (launchTypeSelectIndex != selectIndex) {
				launchTypeSelectIndex = selectIndex;
				initLaunchParamsBySelectIndexFC(paramsid);
			}
		};
	};
	/**
	 * 根据选择的跳转下标，初始化要填写的参数
	 */
	function initLaunchParamsBySelectIndexFC(paramsid) {
		//var launchParamsDiv = document.getElementById("launch_params");
		var launchParamsDiv = document.getElementById(paramsid);
		var html = "";
		if (responseparamsType4Params != null) {
			var item = responseparamsType4Params[launchTypeSelectIndex];
			if (item != null) {
				var launchParams = item.launchParams;
				var list = item.list;
				if(list!=null){
					var length = list.length;
					for(var i = 0; i < length; i++){
						var paramsItem = list[i];
						var type = paramsItem.type;
						var def = paramsItem.def;
						html = html + "<div id='" + paramsItem.name + "'><div>"+ paramsItem.description +":</div>"
						if (type == 0) {
							//输入类型的
							html = html + "<input class='text_input' id='" +  paramsItem.name + "_input' type='text' ";
							if (def != null) {
								html = html + "value='" + def + "'";
							}
							html = html + "/>";
						} else if (type == 1) {
							//0,1单选类型
							html = html + "<label><input type='radio' name='" + paramsItem.name + "' value='0' ";
							if (def != null && def == 0) {
								html = html + "checked='checked'";
							}
							html = html + "/>否</label><label><input type='radio' name='" + paramsItem.name + "' value='1' ";
							if (def != null && def == 1) {
								html = html + "checked='checked'";
							}
							html = html + "/>是</label>";
						} else if (type == 2) {
							var options = paramsItem.option;
							if (options != null) {
								var optionLength = options.length;
								html = html + "<select id='" + paramsItem.name + "_select'>";
								for (var j = 0; j < optionLength; j++) {
									var optionItem = options[j];
									html = html + " <option value='" + optionItem.value + "'";
									if (optionItem.value == def){
										html = html + " selected='selected' ";
									}
									html = html + ">" + optionItem.name + "</option>";
								}
								html = html + "</select>";
							}
						}
						html = html + "</div>";
					}
				}
				if (launchParams != null) {
					var length = launchParams.length;
					for (var i = 0; i < length; i++) {
						var paramsItem = launchParams[i];
						var type = paramsItem.type;
						var def = paramsItem.def;
						html = html + "<div id='" + paramsItem.name + "'><div>"+ paramsItem.description +":</div>"
						if (type == 0) {
							//输入类型的
							html = html + "<input class='text_input' id='" +  paramsItem.name + "_input' type='text' ";
							if (def != null) {
								html = html + "value='" + def + "'";
							}
							html = html + "/>";
						} else if (type == 1) {
							//0,1单选类型
							html = html + "<label><input type='radio' name='" + paramsItem.name + "' value='0' ";
							if (def != null && def == 0) {
								html = html + "checked='checked'";
							}
							html = html + "/>否</label><label><input type='radio' name='" + paramsItem.name + "' value='1' ";
							if (def != null && def == 1) {
								html = html + "checked='checked'";
							}
							html = html + "/>是</label>";
						} else if (type == 2) {
							var options = paramsItem.option;
							if (options != null) {
								var optionLength = options.length;
								html = html + "<select id='" + paramsItem.name + "_select'>";
								for (var j = 0; j < optionLength; j++) {
									var optionItem = options[j];
									html = html + " <option value='" + optionItem.value + "'";
									if (optionItem.value == def){
										html = html + " selected='selected' ";
									}
									html = html + ">" + optionItem.name + "</option>";
								}
								html = html + "</select>";
							}
						}
						html = html + "</div>";
					}
				}
			}
		}
		launchParamsDiv.innerHTML = html;
	};
	/**
	 * 获取下拉列表的值的方法
	 */
	function getSelectValueById(id) {
		var select = document.getElementById(id);
		var selectIndex = select.selectedIndex;
		return select.options[selectIndex].value;
	};
	/**
	 * 获取单选按钮组选择的值的方法
	 */
	function getRadioValueByName(name) {
  		var group = document.getElementsByName(name);
  		if (group != null) {
  			var length = group.length;
	        for(var i = 0; i< length; i++){
	        	   var item = group[i];
	           if(item.checked){
	           	 	return item.value;
	           }
	        }
       	}
        return 0;
	};
	
	/**
	 * 上传图片
	 */
	function uploadImg() {
		//请求地址
		var requestUrl = url + "loan_manager/pushmanage/uploadmessageicon.action?rd=" + new Date().getTime();
		if (debug) {
			console.log("requestUrl:" + requestUrl);
		}
		var iconChooseForm = document.getElementById("icon_choose_form");
		var formData = new FormData(iconChooseForm);
		var xhr = new XMLHttpRequest();
		xhr.onreadystatechange = function(){
			if(xhr.readyState==4) {
				if(xhr.status==200) {
					var result = JSON.parse(xhr.responseText);
					if (result != null && result.url != null && result.url.trim() != "") {
						var newMessage = createMessage(result.url);
						var messageResultShow = document.getElementById("message_result_show");
						messageResultShow.innerHTML = JSON.stringify(newMessage);
					}
				}
				hideLoading();
			}
		};    
		xhr.open("POST" ,requestUrl , true);
		xhr.send(formData);
		showLoading();
	};
	
	/**
	 * 显示loading的方法
	 */
	function showLoading() {
		$(".load_bg").show();
		$(".load_img").show();
	};
	
	/**
	 * 隐藏loading的方法
	 */
	function hideLoading() {
		$(".load_bg").hide();
		$(".load_img").hide();
	};
	
	//跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)的配置参数数据
	var  responseparamsType1Params = [{
	 "name":"车生活入口图标右上角显示小icon",
	 "operate":1,
	 "operateParams":[{"name":"state", "description":"状态", "type": 2, "option":[{"name":"不显示","value":0},{"name":"显示小红点","value":1},{"name":"显示文字+底图的badge","value":2}], "def": 0},{"name":"text", "description":"小icon显示的文本" , "type": 0},{"name":"action", "description":"入口对应的action,与协议相对应，用于匹配哪个图标", "type": 2, "option":[{"name":"本地跳转事件","value":1},{"name":"跳转webview","value":2},{"name":"打开浏览器","value":3},{"name":"走消息中心跳转","value":4}], "def": 1},{"name":"value", "description":"入口action所使用的value,与协议相对应,用于匹配哪个图标" , "type": 0},{"name":"resident", "description":"角标是否常驻显示", "type": 2, "option":[{"name":"不常驻，点击后消失","value":0},{"name":"常驻，点击后仍然显示","value":1}], "def": 0},{"name":"timestamp", "description":"角标更新时间" , "type": 3}]
	},
	{
	 "name":"显示首页3个tab的提醒角标",
	 "operate":11,
	 "operateParams":[{"name":"state", "description":"状态", "type": 2, "option":[{"name":"不显示","value":0},{"name":"显示小红点","value":1},{"name":"显示文字+底图的badge","value":2}], "def": 0},{"name":"tabid", "description":"tab索引", "type": 2, "option":[{"name":"首页","value":0},{"name":"值得买","value":1},{"name":"金币商城","value":2},{"name":"我的","value":3},{"name":"福利","value":4}], "def": 0},{"name":"text", "description":"角标文字" , "type": 0},{"name":"resident", "description":"角标是否常驻显示", "type": 2, "option":[{"name":"不常驻，点击后消失","value":0},{"name":"常驻，点击后仍然显示","value":1}], "def": 0},{"name":"timestamp", "description":"角标更新时间", "type": 3},{"name":"starttime", "description":"消息有效的开始时间,为0则默认有效", "type": 3},{"name":"endtime", "description":"消息有效的结束时间,为0则默认有效", "type": 3},{"name":"pop_img_url", "description":"在tab弹出来的图片地址", "type": 0},{"name":"msg_center_show", "description":"是否展示在消息中心", "type": 2, "option":[{"name":"不展示","value":0},{"name":"在消息中心展示","value":1}], "def": 0},{"name":"launch_param", "description":"点击响应", "type": 4}]
	},
	{
		 "name":"首页右上角铃铛小红点",
		 "operate":8,
		 "operateParams":[{"name":"index", "description":"打开活动页后移到第几张图(从0开始):", "type": 0}]
		},
	{
		 "name":"首页铃铛",
		 "operate":13,
		 "operateParams":[{"name":"imageList", "description":"图片组(以,分开)" , "type": 0},{"name":"time", "description":"持续时间" , "type": 0},{"name":"type", "description":"显示位置(首页：0，加油：1)" , "type": 0}]
		}
	];
	
	//跳转某个应用程序(跳转自身程序内部界面和外部应用都是用这种方式)的配置参数数据
	var  responseparamsType2Params = [
	{
	 "name":"无响应",
	 "launch":"",
	 "launchParams":[]
	},
	{
	 "name":"使用外部浏览器打开网页",
	 "launch":"launch_other_browser",
	 "launchParams":[{"name":"title", "description":"标题" , "type": 0},{"name":"htmlUrl", "description":"打开网页的地址" , "type": 0}]
	},
	{
	 "name":"使用内部webview打开网页",
	 "launch":"launch_vc_webView",
	 "launchParams":[{"name":"title", "description":"内部webview显示的标题" , "type": 0},{"name":"htmlUrl", "description":"打开网页的地址" , "type": 0},{"name":"withHead", "description":"是否带phead" , "type": 1, "def":1},{"name":"showToolbar", "description":"是否显示底部导航栏" , "type": 1, "def":0},{"name":"clearTop", "description":"跳转后是否需要将原来顶级的界面销毁" , "type": 1, "def":0},{"name":"canBlockNetworkImg", "description":"界面是否可以限制网络图片加载" , "type": 1, "def":1},{"name":"reloadWhenLogin", "description":"当用户登录后，是否需要重新加载页面" , "type": 1, "def":1},{"name":"takeOverBackPressed", "description":"是否由html页面接管返回键的处理" , "type": 1, "def":0},{"name":"callbackWhenResumeAndPause", "description":"客户端是否在resume和pause时回调页面接口javascript:onResume()和javascript:onPause()" , "type": 1, "def":0},{"name":"showTitle", "description":"客户端是否显示标题栏" , "type": 1, "def":1},{"name":"injectCss", "description":"客户端是否对加载的页面注入http://xmiles.cn/js_css/xmiles_inject.css" , "type": 1, "def":0}]
	},
	{
	 "name":"跳转消息中心",
	 "launch":"launch_vc_message_center",
	 "launchParams":[{"name":"title", "description":"标题" , "type": 0, "def":"消息中心"},{"name":"showMsgType", "description":"跳转哪一个模块的消息中心", "type": 2, "option":[{"name":"跳转到我的页面消息中心","value":1},{"name":"跳转到车友圈消息中心(暂时没有入口)","value":2}], "def": 1}]
	},
	{
	 "name":"跳转主界面首页、值得买、我的",
	 "launch":"launch_main_tab",
	 "launchParams":[{"name":"tab", "description":"跳转哪一个页面", "type": 2, "option":[{"name":"跳转到首页","value":0},{"name":"跳转到值得买","value":1},{"name":"跳转到我的","value":2}], "def": 0},{"name":"htmlUrl", "description":"跳转到值得买的URL(跳转首页和我的页面不需要填写)" , "type": 0}]
	},
	{
	 "name":"跳转我的点评",
	 "launch":"launch_vc_my_comment",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0, "def":"我的点评"}]
	},
	{
	 "name":"跳转我的订单首页",
	 "launch":"launch_vc_my_order",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0, "def":"我的订单"},{"name":"tab", "description":"跳转哪一个页面", "type": 2, "option":[{"name":"跳转到订单首页","value":0}], "def": 0}]
	},
	{
	 "name":"跳转订单详情界面",
	 "launch":"launch_vc_order_detail",
	 "launchParams":[{"name":"id", "description":"对应的订单id" , "type": 0},{"name":"servicetype", "description":"对应的订单类型(14：违章，25：加油直充，32：加油分期)", "type": 0}]
	},
    {
	 "name":"跳转办违章首页",
	 "launch":"launch_vc_illegal_home",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0, "def":"违章查缴"}]
	},
    {
	 "name":"跳转办违章添加车辆界面",
	 "launch":"launch_vc_illegal_edit",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0, "def":"查询车辆信息"}]
	},
    {
	 "name":"跳转办违章详情界面",
	 "launch":"launch_vc_illegal_detail",
	 "launchParams":[{"name":"id", "description":"车辆id" , "type": 0},{"name":"car_num", "description":"车牌号" , "type": 0},{"name":"eng_num", "description":"发动机号" , "type": 0},{"name":"shelf_num", "description":"车架号" , "type": 0},{"name":"owner_name", "description":"车辆登记人名字" , "type": 0},{"name":"owner_phone", "description":"车辆登记人的手机号码" , "type": 0},{"name":"registerno", "description":"车辆登记证号" , "type": 0},{"name":"city", "description":"查询城市，如果多个城市，用“;”分隔" , "type": 0}]
	},
    {
	 "name":"跳转代驾",
	 "launch":"launch_vc_proxy_driving",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0,"def":"代驾"}]
	},
    {
	 "name":"跳转道路救援",
	 "launch":"launch_vc_proxy_helper",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0,"def":"道路救援"}]
	},
    {
	 "name":"跳转报保险",
	 "launch":"launch_vc_proxy_insurance",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0,"def":"报保险"}]
	},
    {
	 "name":"跳转停车场、交警队、车管所、快撤理赔点、加油站等地图模式的首页",
	 "launch":"launch_vc_map_view",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0}]
	},
    {
	 "name":"跳转洗车美容、保养维修、4s店、保险营业厅等列表模式的首页",
	 "launch":"launch_vc_list_view",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0}]
	},
    {
	 "name":"跳转团购列表模式的首页",
	 "launch":"launch_vc_groupbuy_list",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0, "def":"团购"}]
	},
    {
	 "name":"跳转停车场、加油站、店铺、服务点、团购等详情页面",
	 "launch":"launch_vc_detail",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0},{"name":"productId", "description":"商品id" , "type": 0},{"name":"merchantId", "description":"店铺id" , "type": 0}]
	},
    {
	 "name":"跳转停车场、加油站、店铺等贡献页面",
	 "launch":"launch_vc_contribute",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0}]
	},
    {
	 "name":"跳转点评界面",
	 "launch":"launch_vc_write_review",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0},{"name":"productId", "description":"商品id" , "type": 0},{"name":"merchantId", "description":"店铺id" , "type": 0}]
	},
    {
	 "name":"跳转爆料界面",
	 "launch":"launch_vc_contribute",
	 "launchParams":[{"name":"title", "description":"界面显示的标题" , "type": 0},{"name":"serviceType", "description":"serviceType" , "type": 0},{"name":"productId", "description":"商品id" , "type": 0},{"name":"merchantId", "description":"店铺id" , "type": 0}]
	},
    {
	 "name":"跳转值得买详情页面",
	 "launch":"launch_vc_worth_outlink_detail",
	 "launchParams":[{"name":"id", "description":"商品id" , "type": 0}]
	},
    {
	 "name":"跳转dialog式的webview界面",
	 "launch":"launch_vc_dialog_webview",
	 "launchParams":[{"name":"htmlUrl", "description":"加载页面的url" , "type": 0},{"name":"isaddpoint", "description":"是否添加积分" , "type": 1, "def":1}]
	},
	{
		 "name":"我的（浮层）跳转内部WebView页面",
		 "launch":"launch_vc_supernatant_webView",
		 "list":[{"name":"beforeClickImgList", "description":"点击前图片组" , "type": 0}],
		 "launchParams":[{"name":"title", "description":"内部webview显示的标题" , "type": 0},{"name":"htmlUrl", "description":"打开网页的地址" , "type": 0},{"name":"withHead", "description":"是否带phead" , "type": 1, "def":1},{"name":"showToolbar", "description":"是否显示底部导航栏" , "type": 1, "def":0},{"name":"clearTop", "description":"跳转后是否需要将原来顶级的界面销毁" , "type": 1, "def":0},{"name":"canBlockNetworkImg", "description":"界面是否可以限制网络图片加载" , "type": 1, "def":1},{"name":"reloadWhenLogin", "description":"当用户登录后，是否需要重新加载页面" , "type": 1, "def":1},{"name":"takeOverBackPressed", "description":"是否由html页面接管返回键的处理" , "type": 1, "def":0},{"name":"callbackWhenResumeAndPause", "description":"客户端是否在resume和pause时回调页面接口javascript:onResume()和javascript:onPause()" , "type": 1, "def":0},{"name":"showTitle", "description":"客户端是否显示标题栏" , "type": 1, "def":1},{"name":"injectCss", "description":"客户端是否对加载的页面注入http://xmiles.cn/js_css/xmiles_inject.css" , "type": 1, "def":0}]
	}
	];
	
	var  responseparamsType4Params = [
			{
				 "name":"我的（浮层）跳转内部WebView页面",
				 "launch":"launch_vc_supernatant_webView",
				 "list":[{"name":"beforeClickImgList", "description":"点击前图片组(以,隔开)" , "type": 0},{"name":"afterClickImgList", "description":"点击后图片组(以,隔开)" , "type": 0},{"name":"beforeFrameTime", "description":"点击前动画时间,毫秒单位" , "type": 0},{"name":"afterFrameTime", "description":"点击后动画时间,毫秒单位" , "type": 0}],
				 "launchParams":[{"name":"title", "description":"内部webview显示的标题" , "type": 0},{"name":"htmlUrl", "description":"打开网页的地址" , "type": 0},{"name":"withHead", "description":"是否带phead" , "type": 1, "def":1},{"name":"showToolbar", "description":"是否显示底部导航栏" , "type": 1, "def":0},{"name":"clearTop", "description":"跳转后是否需要将原来顶级的界面销毁" , "type": 1, "def":0},{"name":"canBlockNetworkImg", "description":"界面是否可以限制网络图片加载" , "type": 1, "def":1},{"name":"reloadWhenLogin", "description":"当用户登录后，是否需要重新加载页面" , "type": 1, "def":1},{"name":"takeOverBackPressed", "description":"是否由html页面接管返回键的处理" , "type": 1, "def":0},{"name":"callbackWhenResumeAndPause", "description":"客户端是否在resume和pause时回调页面接口javascript:onResume()和javascript:onPause()" , "type": 1, "def":0},{"name":"showTitle", "description":"客户端是否显示标题栏" , "type": 1, "def":1},{"name":"injectCss", "description":"客户端是否对加载的页面注入http://xmiles.cn/js_css/xmiles_inject.css" , "type": 1, "def":0}]
			}                             
		];
</script>